package io.libp2p.example.chat;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

public class DeviceAdapter extends BaseQuickAdapter<DeviceAdapter.DeviceInfo, BaseViewHolder> {

    public static class DeviceInfo{
        String name;
        String address;

        public DeviceInfo(String name, String address) {
            this.name = name;
            this.address = address;
        }
    }

    public DeviceAdapter(){
        super(R.layout.recycle_device);
    }

    @Override
    protected void convert(BaseViewHolder holder, DeviceInfo item) {
        holder.setText(R.id.device_name, item.name)
                .setText(R.id.device_address, item.address);
    }

}
